//
//  YXBeginViewController.m
//  YXClient
//
//  Created by 张明磊 on 14-8-12.
//  Copyright (c) 2014年 张明磊. All rights reserved.
//

#import "YXBeginViewController.h"
#import "YXCustomPanel.h"
#import "MYBlurIntroductionView.h"

@interface YXBeginViewController ()<MYIntroductionDelegate>

@end

@implementation YXBeginViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self UI_begin];
    self.view.backgroundColor = RGB(91,165,229);
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)UI_begin{
    YXCustomPanel *panel_one = [[YXCustomPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, [UIUtils windowHeight]) andTag:0];
    YXCustomPanel *panel_two = [[YXCustomPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, [UIUtils windowHeight]) andTag:1];
    YXCustomPanel *panel_three = [[YXCustomPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, [UIUtils windowHeight]) andTag:2];
    YXCustomPanel *panel_four = [[YXCustomPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, [UIUtils windowHeight]) andTag:3];
    NSArray *panels = @[panel_one, panel_two, panel_three,panel_four];
    
    MYBlurIntroductionView *introductionView = [[MYBlurIntroductionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    introductionView.delegate = self;
    introductionView.RightSkipButton.hidden = YES;
    //introductionView.BackgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageFileName:@"begin_back.png"]];
    introductionView.LanguageDirection = MYLanguageDirectionLeftToRight;
    [introductionView buildIntroductionWithPanels:panels];
    [self.view addSubview:introductionView];
}

-(void)introduction:(MYBlurIntroductionView *)introductionView didChangeToPanel:(MYIntroductionPanel *)panel withIndex:(NSInteger)panelIndex{
    //NSLog(@"Introduction did change to panel %d", panelIndex);
    
}

-(void)introduction:(MYBlurIntroductionView *)introductionView didFinishWithType:(MYFinishType)finishType {
    //NSLog(@"Introduction did finish");
}

@end
